/**
 * 
 */
package com.bootdo.common.utils;

/**
 * @author Administrator
 *
 */
public class StringUtils {
	public static String leftPadding(String str,int length,String  padding){
    	
    	
    	str = String.format("%"+length+"s",str);
    	
    	if(" ".equals(padding))
    		return str;
    	else
    		return str.replace(" ", padding);
    }
    
    public static String rightPadding(String str,int length,String  padding){
    	
    	
    	str = String.format("%-"+length+"s",str);
    	if(" ".equals(padding))
    		return str;
    	else
    		return str.replace(" ", padding);
    }
}
